﻿using Company.Database.Entities;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Company.Database.Sqlite
{
    class SqliteDbContext : DbContext
    {
        private string name = "ioc.db";
        public DbSet<User> Users { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);

            var local = Environment.SpecialFolder.LocalApplicationData;
            var path = Environment.GetFolderPath(local);
            var fullname = Path.Join(path, name);
            optionsBuilder.UseSqlite($"data source = {fullname}");
        }
    }
}
